<?php
	include "config.inc.php";
	$temp  = explode("_", $_REQUEST['element_id'] );
	$field = $temp[0];
	$id    = $temp[1];
	$textboxval = mysql_real_escape_string(stripslashes(preg_replace('/[\$]/',"",$_REQUEST["update_value"]))); 
	// set older entries to 0 - to not show but show in history
	$hide_notes      = "UPDATE notes SET status = 0";
	mysql_query($hide_notes);
	
	// add new entry with status of 1 to show only latest note
	$query      = "INSERT INTO notes ($field,status,date,c_id) VALUES ('$textboxval','1',NOW(),'$id')";
	mysql_query($query);
	echo($_REQUEST['update_value']);
?>
